<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
		<div class="am-g">
	{include file='../Common/hy_header.html'}
		<form id="formsearch" >
			<div class="am-u-md-12 am-cf">
				<div class="am-u-md-12" style="padding:10px;">
		          <div class="am-input-group am-input-group-sm">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">时间</span>
		          		<input value="{$total.startTime|date_format:'Y-m-d H:i:s'}"  style="width:200px;" type="text" id="startTime" name="startTime" class="field am-form-field hy-js-search">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">至&nbsp;&nbsp;&nbsp;</span>
		          		<input value="{$total.endTime|date_format:'Y-m-d H:i:s'}"  style="width:200px;" type="text" id="endTime" name="endTime" class="field am-form-field hy-js-search">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">评论</span>
		          		<input value="{$total.comment}"  style="width:200px;" type="text" id="comment" name="comment" class="field am-form-field hy-js-search">
		          </div>
		        </div>
				<div class="am-u-md-12" style="padding:10px">
		          <div class="am-input-group am-input-group-sm">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">昵称</span>
		          		<input value="{$total.nickname}"  style="width:200px;" type="text" id="nickname" name="nickname" class="field am-form-field hy-js-search">
		          		<input value="{$total.new_id}" type="hidden"  name="new_id" class="field ">
		          		<input value="{$page}" type="hidden"  name="page" class="field ">
		          		<span class="am-input-group-label" style="background-color: #fff;border: 0px;">精选</span>
						<select name="status" id="status" style="width:200px;" class=" field am-form-field">
			               <option value="all">--- ---</option>
			               <option {if $total.status eq '1'}selected="selected" {/if} value="1">是</option>
			               <option {if $total.status eq '2'}selected="selected" {/if} value="2">否</option>
			            </select>
			            <span class="am-input-group-label" style="background-color: #fff;border: 0px;">记者名</span>
		          		<input value="{$total.reporter_name}"  style="width:200px;" type="text" id="reporter_name" name="reporter_name" class="field am-form-field hy-js-search">
		          </div>
		        </div>
		        <div class="am-u-md-12" style="padding:10px">
		        	<div class="am-input-group am-input-group-sm">
				   		<span class="am-input-group-btn" style=" height: 45px;">
			                  <button class="am-btn am-btn-default bin-select-searchbtn" type="button">搜索</button>
		                </span>
				   		<span class="am-input-group-btn" style=" height: 45px;padding-left: 50px;">
			                  <a  href="javascript:void(0);" onclick="refreshNow()" id="refresh_html"  class="am-btn am-btn-default hy-js-href">刷新</a>
		                </span>
	                </div>
		        </div>
			</div>
		</form>
      <div class="am-g">
      <div class="am-u-sm-12">
        <div class="am-form">
          <table class="am-table am-table-striped am-table-hover table-main">
            <thead>
              <tr>
				<th width="20%" class="table-type">昵称(openid)</th>
				<th width="20%" class="table-type">记者资料</th>
				<th width="23%" class="table-type">评论</th>
				<th width="15%" class="table-author">评论时间</th>
				<th width="10%" class="table-type">精选</th>
              </tr>
          </thead>
          <tbody>
          	   <!--{foreach key=key from=$list item=sql}-->
            <tr>
              <td >{$sql.nickname}<br>{$sql.openid}</td>
              <td ><div style="width:200px;word-wrap: break-word;">{$sql.reporter_name}<br>{$sql.title}</div></td>
              <td ><div style="width:400px;word-wrap: break-word;">{$sql.comment|default:" - "}</div></td>
			  <td >{$sql.create_time|date_format:"Y-m-d H:i:s"}</td>
			  <td ><input {if $sql.status==1}checked=checked{/if} type="checkbox" onclick="addDigest({$sql.id},this)" name="addStatus"></td>
            </tr>
                  <!--{/foreach}-->  
          </tbody>
        </table>
		 <div class="am-cf">
          <div class="am-fr">

  	<div class="hy_page">
  {$list_page}
  </div>
</div>
</div>
          <hr />
      
        </div>
      </div>

    </div>
    </div>
   {include file='../Common/hy_footer.html'}
   <script type="text/javascript" src="{$_C.hy_path}js/laydate/laydate.js"></script>
   <script type="text/javascript" src="{$_C.hy_path}js/Map.js"></script>
   <script type="text/javascript" src="{$_C.hy_path}js/bin.select.js"></script>
   <script type="text/javascript">
   	$(function(){
		laydate({
			   elem: '#startTime',
			   istime:true,
			   format: 'YYYY-MM-DD hh:mm:ss',
			});
		laydate({
			   elem: '#endTime',
			   istime:true,
			   format: 'YYYY-MM-DD hh:mm:ss',
			})
	})
	
	function addDigest(id,params){
				var url = "index.php?g=admin&m=reporter&a=addDigest";
				var data={
						'id':id
					}
				$.post(url,data,function(res){
					if(res.error==0){
						showMsg(res.content,res.error);
					}else{
						params.checked=false;
						alert(res.content);
					}
				},'json');
		}
	
	$('.bin-select-searchbtn').click(function(){
		var url = window.location.href;
           url = url.substring(0,url.indexOf("?"));
		   url+="?g=admin&m=reporter&a=reportCommentList";
		var json = uriJson(bulidFilterParams($("#formsearch")));
		if(json!=""&&json!=null&&json!=undefined){
			window.location.href=url+"&"+json;
		}
	});
	
	function loadPage(where){
		var url = window.location.href;
           url = url.substring(0,url.indexOf("?"));
		   url+="?g=admin&m=reporter&a=reportCommentList";
		var json = uriJson(bulidFilterParams($("#formsearch")));
		if(json!=""&&json!=null&&json!=undefined){
			window.location.href=url+"&"+json+where;
		}else{
			window.location.href=url+where;
		}
	}
	
	function refreshNow()
	{
		parent.$('#reportCommentList').attr('src', parent.$('#reportCommentList').attr('src'));
	}
   </script>
	</body>
</html>
